@@ -20,8 +20,8 @@ android { |
||
20 | 20 |
applicationId "ai.pai.lensman" |
21 | 21 |
minSdkVersion MIN_SDK_VERSION as int |
22 | 22 |
targetSdkVersion TARGET_SDK_VERSION as int |
23 |
- versionCode 1026 |
|
24 |
- versionName "1.0.26" |
|
23 |
+ versionCode 1027 |
|
24 |
+ versionName "1.0.27" |
|
25 | 25 |
buildConfigField "boolean", "isTestMode", "true" |
26 | 26 |
manifestPlaceholders = [CHANNEL_NAME: "guanwang"] |
27 | 27 |
} |
@@ -5,7 +5,9 @@ import android.graphics.Color; |
||
5 | 5 |
import android.os.Bundle; |
6 | 6 |
import android.support.annotation.IdRes; |
7 | 7 |
import android.support.annotation.Nullable; |
8 |
+import android.text.SpannableString; |
|
8 | 9 |
import android.text.TextUtils; |
10 |
+import android.text.style.UnderlineSpan; |
|
9 | 11 |
import android.view.Gravity; |
10 | 12 |
import android.view.View; |
11 | 13 |
import android.widget.RadioGroup; |
@@ -40,6 +42,7 @@ public class BriefsActivity extends BaseActivity implements BriefsContract.View{ |
||
40 | 42 |
@BindView(R.id.tv_box_status) TextView boxStatusText; |
41 | 43 |
@BindView(R.id.tv_current_price) TextView currentPriceText; |
42 | 44 |
@BindView(R.id.rg_upload_settings) RadioGroup uploadDelayRadioGroup; |
45 |
+ @BindView(R.id.tv_box_version) TextView boxVersionText; |
|
43 | 46 |
private BriefsPresenter presenter; |
44 | 47 |
|
45 | 48 |
@Override |
@@ -79,9 +82,17 @@ public class BriefsActivity extends BaseActivity implements BriefsContract.View{ |
||
79 | 82 |
}; |
80 | 83 |
orderMsgSwitch.setFactory(factory); |
81 | 84 |
systemMsgSwitch.setFactory(factory); |
85 |
+ String version = String.valueOf(Preferences.getInstance().getBoxVersionCode()); |
|
86 |
+ SpannableString content = new SpannableString(version +" "+ getString(R.string.upgrade_now)); |
|
87 |
+ content.setSpan(new UnderlineSpan(), version.length()+1, content.length(), 0); |
|
88 |
+ boxVersionText.setText(content); |
|
82 | 89 |
presenter = new BriefsPresenter(this,this); |
83 | 90 |
} |
84 | 91 |
|
92 |
+ @OnClick(R.id.tv_box_version) |
|
93 |
+ public void checkBoxUpdate(){ |
|
94 |
+ presenter.clickBoxUpdate(); |
|
95 |
+ } |
|
85 | 96 |
|
86 | 97 |
@OnClick(R.id.switcher_order_msg) |
87 | 98 |
public void clickOrderMsg(){ |
@@ -20,6 +20,7 @@ public class BriefsContract { |
||
20 | 20 |
void clickCurrentOrderMsg(); |
21 | 21 |
void clickCurrentSysMsg(); |
22 | 22 |
void clickSettingPrice(); |
23 |
+ void clickBoxUpdate(); |
|
23 | 24 |
} |
24 | 25 |
|
25 | 26 |
|
@@ -2,6 +2,7 @@ package ai.pai.lensman.briefs; |
||
2 | 2 |
|
3 | 3 |
import android.content.Context; |
4 | 4 |
import android.content.Intent; |
5 |
+import android.widget.Toast; |
|
5 | 6 |
|
6 | 7 |
import com.android.common.utils.NetworkUtil; |
7 | 8 |
|
@@ -17,15 +18,19 @@ import ai.pai.lensman.base.BaseInteractor; |
||
17 | 18 |
import ai.pai.lensman.bean.BriefsBean; |
18 | 19 |
import ai.pai.lensman.bean.MessageBean; |
19 | 20 |
import ai.pai.lensman.bean.SystemMessageBean; |
21 |
+import ai.pai.lensman.db.Preferences; |
|
20 | 22 |
import ai.pai.lensman.main.QueryBoxStatusInteractor; |
23 |
+import ai.pai.lensman.upgrade.BoxUpgradeActivity; |
|
24 |
+import ai.pai.lensman.upgrade.CheckBoxUpgradeInfoInteractor; |
|
21 | 25 |
|
22 | 26 |
public class BriefsPresenter implements BriefsContract.Presenter,BaseInteractor.InteractorListener<BriefsBean>, |
23 |
- QueryBoxStatusInteractor.BoxStatusListener { |
|
27 |
+ QueryBoxStatusInteractor.BoxStatusListener,CheckBoxUpgradeInfoInteractor.FetchUpgradeInfoListener { |
|
24 | 28 |
|
25 | 29 |
private Context context; |
26 | 30 |
private BriefsContract.View briefsView; |
27 | 31 |
private BriefsInteractor interactor; |
28 | 32 |
private QueryBoxStatusInteractor boxStatusInteractor; |
33 |
+ private CheckBoxUpgradeInfoInteractor checkBoxUpgradeInfoInteractor; |
|
29 | 34 |
|
30 | 35 |
private BriefsBean briefsBean; |
31 | 36 |
private String NULL_STR = ""; |
@@ -51,6 +56,9 @@ public class BriefsPresenter implements BriefsContract.Presenter,BaseInteractor. |
||
51 | 56 |
public void stop() { |
52 | 57 |
interactor.cancelJob(); |
53 | 58 |
boxStatusInteractor.cancelJob(); |
59 |
+ if(checkBoxUpgradeInfoInteractor!=null){ |
|
60 |
+ checkBoxUpgradeInfoInteractor.cancelJob(); |
|
61 |
+ } |
|
54 | 62 |
if(timer!=null){ |
55 | 63 |
timer.cancel(); |
56 | 64 |
} |
@@ -138,4 +146,20 @@ public class BriefsPresenter implements BriefsContract.Presenter,BaseInteractor. |
||
138 | 146 |
intent.putExtra("nomark",briefsBean.noMarkPrice); |
139 | 147 |
context.startActivity(intent); |
140 | 148 |
} |
149 |
+ |
|
150 |
+ @Override |
|
151 |
+ public void clickBoxUpdate() { |
|
152 |
+ checkBoxUpgradeInfoInteractor = new CheckBoxUpgradeInfoInteractor(Preferences.getInstance().getLensManId(),this); |
|
153 |
+ checkBoxUpgradeInfoInteractor.startJob(); |
|
154 |
+ } |
|
155 |
+ |
|
156 |
+ @Override |
|
157 |
+ public void onUpgradeInfoFetched(boolean result, String bpversion_str, int versionCode) { |
|
158 |
+ if(result){ |
|
159 |
+ BoxUpgradeActivity.startBoxUpgradeActivity(context,bpversion_str,versionCode); |
|
160 |
+ }else{ |
|
161 |
+ Toast.makeText(context,R.string.current_version_is_latest,Toast.LENGTH_SHORT).show(); |
|
162 |
+ } |
|
163 |
+ |
|
164 |
+ } |
|
141 | 165 |
} |
@@ -269,7 +269,6 @@ class MainPresenter implements MainContract.Presenter,SyncTimeInteractor.SyncTim |
||
269 | 269 |
isBoxUpdateChecked = true; |
270 | 270 |
if(result){ |
271 | 271 |
view.showBoxUpgradeActivity(bpversion_str,versionCode); |
272 |
- |
|
273 | 272 |
} |
274 | 273 |
} |
275 | 274 |
|
@@ -447,6 +447,36 @@ |
||
447 | 447 |
android:textSize="14sp" /> |
448 | 448 |
</LinearLayout> |
449 | 449 |
|
450 |
+ <View |
|
451 |
+ android:layout_width="match_parent" |
|
452 |
+ android:layout_height="1px" |
|
453 |
+ android:background="@color/text_hint_grey_color" /> |
|
454 |
+ |
|
455 |
+ <LinearLayout |
|
456 |
+ android:layout_width="match_parent" |
|
457 |
+ android:layout_height="44dp" |
|
458 |
+ android:orientation="horizontal"> |
|
459 |
+ |
|
460 |
+ <TextView |
|
461 |
+ android:layout_width="wrap_content" |
|
462 |
+ android:layout_height="wrap_content" |
|
463 |
+ android:layout_gravity="center_vertical" |
|
464 |
+ android:paddingLeft="10dp" |
|
465 |
+ android:text="@string/firmware_version" |
|
466 |
+ android:textColor="@color/dark_grey" |
|
467 |
+ android:textSize="16sp" /> |
|
468 |
+ |
|
469 |
+ <TextView |
|
470 |
+ android:id="@+id/tv_box_version" |
|
471 |
+ android:layout_width="0dp" |
|
472 |
+ android:layout_height="match_parent" |
|
473 |
+ android:layout_weight="1" |
|
474 |
+ android:gravity="center_vertical|right" |
|
475 |
+ android:paddingRight="10dp" |
|
476 |
+ android:textColor="@color/grey" |
|
477 |
+ android:textSize="14sp" /> |
|
478 |
+ </LinearLayout> |
|
479 |
+ |
|
450 | 480 |
</LinearLayout> |
451 | 481 |
|
452 | 482 |
<LinearLayout |
@@ -122,6 +122,8 @@ |
||
122 | 122 |
|
123 | 123 |
<string name="box_status">盒子状态</string> |
124 | 124 |
|
125 |
+ <string name="firmware_version">固件版本</string> |
|
126 |
+ |
|
125 | 127 |
<string name="price_manage">价格管理</string> |
126 | 128 |
|
127 | 129 |
<string name="platform_price_rule">分成及结算规则</string> |